<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div class="box">
        <ul>
            <!-- v-for可以遍历数组  v-for="(数组中的每一项,下标) in(或of) 数组名 :key  后面跟的是唯一标识"
            :key  后面跟的是唯一标识 必须写   (括号可省略,但两个或多个不建议省略)
            -->
            <!-- <li v-for="(item,index) in list">{{index}}-----{{item.name}</li> -->
            <!-- <li v-for="(item,index) in list" :key="item.id">{{index}}-----{{item.name}}-------{{item.id}}</li> -->
        </ul>
        <ul>
            <!-- v-for遍历对象 
            
            -->
            <li v-for="(value,name,index) in obj" :key="index"> <!--:key没有唯一值就写index-->
                {{value}}----{{name}}----{{index}}
            </li>
        </ul>
    </div>
    <script>
        //v-for可以用来进行遍历 对数组和对象进行遍历
        let vm = new Vue({
            el:".box",
            data:{
                list:[{id:'01',name:'777'},{id:'02',name:'888'},{id:'03',name:"999"}],
                obj:{
                    name:'王洋洋',
                    age:18,
                    sex:'男',
                    hobby:'游戏'
                }
            }
        })
    </script>
</body>
</html>